<!doctype html>
<html lang="en">
<head>
    <title>Code coverage report for src/assets/octopus/engine/control.js</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="..\..\..\..\prettify.css" />
    <link rel="stylesheet" href="..\..\..\..\base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style type='text/css'>
        .coverage-summary .sorter {
            background-image: url(..\..\..\..\sort-arrow-sprite.png);
        }
    </style>
</head>
<body>
<div class='wrapper'>
  <div class='pad1'>
    <h1>
      <a href="..\..\..\..\index.html">All files</a> / <a href="index.html">src/assets/octopus/engine</a> control.js
    </h1>
    <div class='clearfix'>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Statements</span>
        <span class='fraction'>0/134</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Branches</span>
        <span class='fraction'>0/72</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Functions</span>
        <span class='fraction'>0/33</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Lines</span>
        <span class='fraction'>0/134</span>
      </div>
    </div>
  </div>
  <div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">function <span class="fstat-no" title="function not covered" >oControlEngine(engine) {</span>
<span class="cstat-no" title="statement not covered" >  this.engine = engine;</span>
&nbsp;
}
&nbsp;
oControlEngine.prototype = {
  //
  render: <span class="fstat-no" title="function not covered" >function () </span>{
  },
  renderLabel: <span class="fstat-no" title="function not covered" >function (</span>control, data) {
    let control_content = <span class="cstat-no" title="statement not covered" >control.find("input");</span>
<span class="cstat-no" title="statement not covered" >    control_content.attr("readonly", true);</span>
  },
  // 渲染日历组件
  renderCalendar: <span class="fstat-no" title="function not covered" >function (</span>control, data) {
    // 获得控件主体，外加基础绑定，日历框不允许手工修改，只能点点点，同时针对List模式，需要绑定2个。
    let control_content = <span class="cstat-no" title="statement not covered" >control.find("input");</span>
&nbsp;
    // 绑定2种日历控件，区分日历框和日历时间狂。
    // 官网：http://www.bootcss.com/p/bootstrap-datetimepicker
<span class="cstat-no" title="statement not covered" >    if (data.controlTypeID == "5") {</span>
      // control_content.datetimepicker({
      //   language: "zh-CN",
      //   format: 'yyyy-mm-dd',
      //   weekStart: 1,// 一周从哪一天开始
      //   todayBtn: 1,// 今天的按钮
      //   autoclose: 1,// 选择完日期就关闭，不选择事件
      //   todayHighlight: 1,// 今日高亮
      //   startView: 2,// 面板打开后首先显示的视图，1：小时；2：日；3：月；4：年；5：10年表
      //   minView: 2,// 展开的最小粒度：0：分钟；1：小时；2：日；3：月；4：年；5：10年表
      //   forceParse: 1,// 强制解析，尽可能识别正
      //   bootcssVer: 3
      // }).on('hide', function () {
      //   // 如果 v-model 有 lazy 修饰符的话，则通过如下调用，需要注意的是[0]下标一定要加，而且input只能找到一个。
      //   $(this)[0].dispatchEvent(new Event('change'));
      // });
      // // calInput.on("blur",function () {
      // //   $(this).val("1999-9-9");
      // //   //我们可以主动通知浏览器进行事件分发，让Vue监听到，做法如下：
      // //   // $(this)[0].dispatchEvent(new Event('input'));
      // //   //如果 v-model 有 lazy 修饰符的话，则通过如下调用，需要注意的是[0]下标一定要加，而且input只能找到一个。
      // //   $(this)[0].dispatchEvent(new Event('change'));
      // // });
&nbsp;
    } else {
      // control_content.datetimepicker({
      //   language: "zh-CN",
      //   format: 'yyyy-mm-dd hh:ii:ss',
      //   weekStart: 1,
      //   todayBtn: 1,
      //   autoclose: 1,
      //   todayHighlight: 1,
      //   startView: 2,
      //   minView: 0,// 最小粒度是到分钟级，但是展开面板视图是天。
      //   forceParse: 1,
      //   bootcssVer: 3
      // }).on('hide', function () {
      //   // 如果 v-model 有 lazy 修饰符的话，则通过如下调用，需要注意的是[0]下标一定要加，而且input只能找到一个。
      //   $(this)[0].dispatchEvent(new Event('change'));
      // });
    }
  },
  renderDropDownList: <span class="fstat-no" title="function not covered" >function (</span>control, data) {
    let o = <span class="cstat-no" title="statement not covered" >this;</span>
    // 配置控件主体对象
    let control_content = <span class="cstat-no" title="statement not covered" >{</span>
      control: control.find(".iControl"),
      textBox: $(document.createElement("input")),
      valueBox: control.find(".iControl input"),
    };
&nbsp;
    // 配置控件下拉面板对象（此对象可复用）
    let control_panel = <span class="cstat-no" title="statement not covered" >{</span>
      control: control.find(".iControlDropDown"),
      searchBox: control.find(".iControlDropDown .Search"),
      clearBox: control.find(".iControlDropDown .Clear"),
      rootBox: control.find(".iControlDropDown .Root"),
      enable: true,
      sequence: 0,
      status: 0, // 0关闭，1开启
    };
&nbsp;
    // 主体控件配置
<span class="cstat-no" title="statement not covered" >    control_content.control.append(control_content.textBox); // 追加至主体控件</span>
<span class="cstat-no" title="statement not covered" >    control_content.textBox.attr("readonly", true);// 显示控件设置为只读</span>
<span class="cstat-no" title="statement not covered" >    control_content.valueBox.hide(); // 主体控件的值控件（VUE DOM）设置为隐藏</span>
&nbsp;
    // 渲染下拉面板，同时设置返回数据源回调事件。
<span class="cstat-no" title="statement not covered" >    this.renderDropPanel(data, control_content, control_panel,</span>
      // LoadBack 加载回调就一次。
<span class="fstat-no" title="function not covered" >      function (</span>result) {
        // 只会而且只能得到一个值。
<span class="cstat-no" title="statement not covered" >        if (result.content.queryData.length == 1) {</span>
          // 只会得到一个值，赋给show ui控件。
<span class="cstat-no" title="statement not covered" >          control_content.textBox.val(result.content.queryData[0][data.controlSourceText]);</span>
        }
        // 如果是层级结构 且 值盒子为0，则填充为Root，表示为根。
        else <span class="cstat-no" title="statement not covered" >if (result.content.parentModel &amp;&amp; control_content.valueBox.val() == "0") {</span>
<span class="cstat-no" title="statement not covered" >          control_content.textBox.val("Root");</span>
        }
        // 如果没有数据 且 控件本身有值 则 说明关联表中已经不存在该数据，问题很严重，应当异常提醒。
        else <span class="cstat-no" title="statement not covered" >if (!o.engine.tools.IsNullOrEmpty(control_content.valueBox.val())) {</span>
          // 弹出提示
<span class="cstat-no" title="statement not covered" >          control_content.textBox.val("N/A: " + control_content.valueBox.val());</span>
        }
        // console.log("loadback:" + JSON.stringify(result));
      },
      // Item Click Back 选项单击回调，但是只有当没有下拉数据时点击面板弹出才触发该事件。
<span class="fstat-no" title="function not covered" >      function (</span>text, value) {
        // 追加到UI层
<span class="cstat-no" title="statement not covered" >        control_content.textBox.val(text);</span>
        // 追加到VUE DOM
<span class="cstat-no" title="statement not covered" >        control_content.valueBox.val(value);</span>
<span class="cstat-no" title="statement not covered" >        $(control_content.valueBox)[0].dispatchEvent(new Event('change'));</span>
      }
    );
  },
  /**
   * 渲染异步复选框
   *
   * @author Marco Yang
   * @version 1.0.0.0
   * @since Created in 2019-05-09 21:24
   */
  renderMultipleDownList: <span class="fstat-no" title="function not covered" >function (</span>control, data) {
    let o = <span class="cstat-no" title="statement not covered" >this;</span>
    // 配置控件主体对象
    let control_content = <span class="cstat-no" title="statement not covered" >{</span>
      control: control.find(".iControl"),
      listBox: $(document.createElement("div")),
      valueBox: control.find(".iControl input"),
    };
&nbsp;
    // 配置控件下拉面板对象（此对象可复用）
    let control_panel = <span class="cstat-no" title="statement not covered" >{</span>
      control: control.find(".iControlDropDown"),
      searchBox: control.find(".iControlDropDown .Search"),
      clearBox: control.find(".iControlDropDown .Clear"),
      rootBox: control.find(".iControlDropDown .Root"),
      enable: true,
      sequence: 0,
      status: 0, // 0关闭，1开启
    };
&nbsp;
    // 主体控件配置
<span class="cstat-no" title="statement not covered" >    control_content.control.append(control_content.listBox); // 追加至主体控件</span>
<span class="cstat-no" title="statement not covered" >    control_content.listBox.addClass("ListBox");// 追加List样式</span>
<span class="cstat-no" title="statement not covered" >    control_content.valueBox.hide(); // 主体控件的值控件（VUE DOM）设置为隐藏</span>
&nbsp;
    // 设置关闭按钮事件，禁用时因为X被隐藏，所以就算绑定事件也没事，压根点不到，哈哈哈。
<span class="cstat-no" title="statement not covered" >    control_content.listBox.on("click", ".icon", <span class="fstat-no" title="function not covered" >function () </span>{</span>
      let removeValue = <span class="cstat-no" title="statement not covered" >$(this).attr("value");</span>
      let newValue = <span class="cstat-no" title="statement not covered" >"," + control_content.valueBox.val() + ",";</span>
<span class="cstat-no" title="statement not covered" >      newValue = newValue.replace("," + removeValue + ",", ",");</span>
      // 去掉头部的逗号[,]
<span class="cstat-no" title="statement not covered" >      if (newValue.length &gt; 1) {</span>
<span class="cstat-no" title="statement not covered" >        newValue = newValue.substring(1);</span>
      }
      // 去掉结尾的逗号[,]
<span class="cstat-no" title="statement not covered" >      if (newValue.substring(newValue.length - 1) == ",") {</span>
<span class="cstat-no" title="statement not covered" >        newValue = newValue.substring(0, newValue.length - 1);</span>
      }
<span class="cstat-no" title="statement not covered" >      control_content.valueBox.val(newValue);</span>
<span class="cstat-no" title="statement not covered" >      $(control_content.valueBox)[0].dispatchEvent(new Event('change'));</span>
      // 移除对象
<span class="cstat-no" title="statement not covered" >      $(this).parent().remove();</span>
    });
&nbsp;
    // 渲染下拉面板，同时设置返回数据源回调事件。
<span class="cstat-no" title="statement not covered" >    this.renderDropPanel(data, control_content, control_panel,</span>
      // LoadBack 加载回调就一次。
<span class="fstat-no" title="function not covered" >      function (</span>result) {
<span class="cstat-no" title="statement not covered" >        $(control_content.valueBox.val().split(",")).each(<span class="fstat-no" title="function not covered" >function (</span>index, value) {</span>
          let cellData = <span class="cstat-no" title="statement not covered" >$.grep(result.content.queryData, <span class="fstat-no" title="function not covered" >function (</span>curr, i) {</span>
<span class="cstat-no" title="statement not covered" >            return curr[data.controlSourceValue] == value;</span>
          });
          // 如果是层级 且 value = 0 则填充根节点。
<span class="cstat-no" title="statement not covered" >          if (result.content.parentModel &amp;&amp; value == 0) {</span>
<span class="cstat-no" title="statement not covered" >            control_content.listBox.append("&lt;div&gt;&lt;span class='text'&gt;Root&lt;/span&gt;&lt;span class='icon icon-guanbi'value='0'&gt;&lt;/span&gt;&lt;/div&gt;");</span>
          } else {
            // 默认未找到，如果有数据则进行替换，然后赋值。
            let cellText = <span class="cstat-no" title="statement not covered" >"N/A: " + value;</span>
<span class="cstat-no" title="statement not covered" >            if (cellData.length == 1) {</span>
<span class="cstat-no" title="statement not covered" >              cellText = cellData[0][data.controlSourceText];</span>
            }
<span class="cstat-no" title="statement not covered" >            control_content.listBox.append("&lt;div&gt;&lt;span class='text'&gt;" + cellText + "&lt;/span&gt;&lt;span class='icon icon-guanbi'value='" + value + "'&gt;&lt;/span&gt;&lt;/div&gt;");</span>
          }
        });
      },
      // Item Click Back 单击回调，但是只有当没有下拉数据时点击面板弹出才触发该事件。
<span class="fstat-no" title="function not covered" >      function (</span>text, value) {
        // 判断是否已存在
<span class="cstat-no" title="statement not covered" >        if (("," + control_content.valueBox.val() + ",").indexOf("," + value + ",") == -1) {</span>
          // 追加到UI层
<span class="cstat-no" title="statement not covered" >          control_content.listBox.append("&lt;div&gt;&lt;span class='text'&gt;" + text + "&lt;/span&gt;&lt;span class='icon icon-guanbi'value='" + value + "'&gt;&lt;/span&gt;&lt;/div&gt;");</span>
          // 追加到VUE DOM
          let listValue = <span class="cstat-no" title="statement not covered" >control_content.valueBox.val();</span>
<span class="cstat-no" title="statement not covered" >          listValue = listValue.length &gt; 0 ? listValue + "," + value : value;</span>
<span class="cstat-no" title="statement not covered" >          control_content.valueBox.val(listValue);</span>
<span class="cstat-no" title="statement not covered" >          $(control_content.valueBox)[0].dispatchEvent(new Event('change'));</span>
        } else {
<span class="cstat-no" title="statement not covered" >          o.engine.tips.warning(text + " 已被选取，请勿重复选择。");</span>
        }
      }
    );
&nbsp;
  },
  /**
   * 通用下拉面板，适用于所有需要下拉的控件。
   *
   * @author Marco Yang
   * @version 1.0.0.0
   * @since Created in 2019-05-09 21:28
   */
  renderDropPanel: <span class="fstat-no" title="function not covered" >function (</span>data, content, panel, loadback, clickback) {
    let o = <span class="cstat-no" title="statement not covered" >this;</span>
    // 确保控件请求前已经满足属性要求
<span class="cstat-no" title="statement not covered" >    if (!this.engine.tools.IsNullOrEmpty(data.controlSourceID)</span>
      &amp;&amp; !this.engine.tools.IsNullOrEmpty(data.controlSourceText)
      &amp;&amp; !this.engine.tools.IsNullOrEmpty(data.controlSourceValue)
      &amp;&amp; !this.engine.tools.IsNullOrEmpty(data.controlSourceOrder)) {
&nbsp;
      // 根据value渲染数据，并抽取数据，前提是有数据值，没有则不发起 LoadBack 加载回调。
<span class="cstat-no" title="statement not covered" >      if (!this.engine.tools.IsNullOrEmpty(content.valueBox.val())) {</span>
        let searchValue = <span class="cstat-no" title="statement not covered" >[];</span>
<span class="cstat-no" title="statement not covered" >        $(content.valueBox.val().split(",")).each(<span class="fstat-no" title="function not covered" >function (</span>index, item) {</span>
<span class="cstat-no" title="statement not covered" >          searchValue.push(item);</span>
        });
        let control_request_celldata = <span class="cstat-no" title="statement not covered" >[{name: data.controlSourceText},</span>
          {name: data.controlSourceValue, searchKey: "IN", searchValue: searchValue}];
        // 触发load加载回调，只有有数据，才有触发的必要，否则都是空，触发个毛线。
<span class="cstat-no" title="statement not covered" >        this.renderRequest({</span>
          cellData: control_request_celldata,
          config: data,
          model: "standard", // 模式设置为【标准】，否则在层级模式下会找不到匹配项目，因为根据父ID筛选了过滤条件以后，只会返回一条数据。。。
          callback: <span class="fstat-no" title="function not covered" >function (</span>result) {
            // 加载回调，针对不同控件，由主控件自由发挥。
<span class="cstat-no" title="statement not covered" >            if (loadback) {</span>
<span class="cstat-no" title="statement not covered" >              loadback(result);</span>
            }
          }
        });
      }
&nbsp;
      // 非禁用才触发
<span class="cstat-no" title="statement not covered" >      if (!data.disabled) {</span>
<span class="cstat-no" title="statement not covered" >        content.control.on("click", <span class="fstat-no" title="function not covered" >function () </span>{</span>
          // 展开面板，为了适应复选框，完美的写法如下，需要+空字符串转字符串。
<span class="cstat-no" title="statement not covered" >          if (($(event.target).attr("class") + "").indexOf("icon-guanbi") == -1) {</span>
            let panelWidth = <span class="cstat-no" title="statement not covered" >content.control.width() + 29;</span>
            // console.log("panel width:" + panelWidth);
<span class="cstat-no" title="statement not covered" >            panel.control.css("width", panelWidth);</span>
            // panel.control.attr("lllll", panelWidth);
<span class="cstat-no" title="statement not covered" >            panel.control.slideDown(300, <span class="fstat-no" title="function not covered" >function () </span>{</span>
<span class="cstat-no" title="statement not covered" >              panel.status = 1; //展开后变为1</span>
<span class="cstat-no" title="statement not covered" >              panel.searchBox.focus();</span>
            });
          }
&nbsp;
          // 只有数据为空的时候，点击click才会重新启动。
          // if (panel.control.find(".Item").length == 0) {
<span class="cstat-no" title="statement not covered" >          if (data.refresh) {</span>
            // 默认根盒子隐藏，后面满足条件才展开。
<span class="cstat-no" title="statement not covered" >            panel.rootBox.hide();</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >            panel.control.find(".Item").remove();</span>
            let control_request_celldata = <span class="cstat-no" title="statement not covered" >[{name: data.controlSourceText}, {name: data.controlSourceValue}];</span>
            // 是否存在-1
            let isExistNoValue = <span class="cstat-no" title="statement not covered" >false;</span>
            // 循环 关联数据 对查询数据进行过滤
&nbsp;
<span class="cstat-no" title="statement not covered" >            o.renderRequest({</span>
              cellData: control_request_celldata,
              config: data,
              callback: <span class="fstat-no" title="function not covered" >function (</span>result) {
                // 如果是层级模式
<span class="cstat-no" title="statement not covered" >                if (result.content.parentModel) {</span>
                  // 如果是层级模式，则隐藏查询框
<span class="cstat-no" title="statement not covered" >                  panel.searchBox.hide();</span>
                  // 层级模式下，且关联对象都不为-1，启动根节点设置，默认：0
<span class="cstat-no" title="statement not covered" >                  if (!isExistNoValue) {</span>
<span class="cstat-no" title="statement not covered" >                    panel.rootBox.show();</span>
                    // panel.control.append("&lt;div class='Item Root' value='0'&gt;===Root===&lt;/div&gt;");
                  }
                }
&nbsp;
<span class="cstat-no" title="statement not covered" >                $(result.content.queryData).each(<span class="fstat-no" title="function not covered" >function (</span>index, cell) {</span>
                  // 识别级别，为什么只处理这一段，因为层级模式下，不能搜索，只能选择，故只有这里才有作用。
                  let levelClass = <span class="cstat-no" title="statement not covered" >"";</span>
                  // let currItem = ""; // 层级数据源的特性，针对选中的项会高亮，这在标准模式下不能实现，因为只能返回30行，默认加载大概率不会找到选中值。
                  let itemValue = <span class="cstat-no" title="statement not covered" >cell[data.controlSourceValue];</span>
                  // 如果存在级别，则说明当前是层级模式
<span class="cstat-no" title="statement not covered" >                  if (!o.engine.tools.IsNullOrEmpty(cell["ParentLevel"])) {</span>
<span class="cstat-no" title="statement not covered" >                    levelClass = " level_" + cell["ParentLevel"];</span>
                  }
                  // 循环valueBox，同时适配单选和复选下拉框的数据源。这个功能主要用于实现下拉框中显示选中的项目，后期加上。
                  // $(content.valueBox.val().split(",")).each(function (index, item) {
                  //   if (itemValue == item) {
                  //     currItem = " Item_Curr";
                  //   }
                  // });
                  // panel.control.append("&lt;div class='Item" + currItem + levelClass + "' value='" + itemValue + "'&gt;" + cell[data.controlSourceText] + "&lt;/div&gt;");
<span class="cstat-no" title="statement not covered" >                  panel.control.append("&lt;div class='Item" + levelClass + "' value='" + itemValue + "'&gt;" + cell[data.controlSourceText] + "&lt;/div&gt;");</span>
                });
&nbsp;
                // 刷新成功以后标记为false
<span class="cstat-no" title="statement not covered" >                data.refresh = false;</span>
              }
            });
          }
        });
&nbsp;
        // 下拉内容选择事件
<span class="cstat-no" title="statement not covered" >        panel.control.on("click", ".Item", <span class="fstat-no" title="function not covered" >function () </span>{</span>
          // 查询回调，针对不同控件，由主控件自由发挥。
<span class="cstat-no" title="statement not covered" >          if (clickback) {</span>
            let text = <span class="cstat-no" title="statement not covered" >$(this).text();</span>
            let value = <span class="cstat-no" title="statement not covered" >$(this).attr("value");</span>
<span class="cstat-no" title="statement not covered" >            clickback(text, value);</span>
          }
        });
&nbsp;
        // 根节点事件
<span class="cstat-no" title="statement not covered" >        panel.rootBox.on("click", <span class="fstat-no" title="function not covered" >function () </span>{</span>
          // 查询回调，针对不同控件，由主控件自由发挥。
<span class="cstat-no" title="statement not covered" >          if (clickback) {</span>
<span class="cstat-no" title="statement not covered" >            clickback("Root", 0);</span>
          }
        });
&nbsp;
        // // 下拉内容输入框失去焦点事件
        // panel.searchBox.on("blur", function () {
        //   setTimeout(function () {
        //     panel.control.slideUp(200);
        //   }, 200);
        // });
&nbsp;
        // 鼠标单击事件，主要为了配合自适应收缩面板。
<span class="cstat-no" title="statement not covered" >        $(document).on("mousedown", <span class="fstat-no" title="function not covered" >function (</span>event) {</span>
          var e = <span class="cstat-no" title="statement not covered" >event;</span>
          var x = <span class="cstat-no" title="statement not covered" >e.pageX || e.clientX + document.body.scroolLeft;</span>
          var y = <span class="cstat-no" title="statement not covered" >e.pageY || e.clientY + document.body.scrollTop;</span>
          var ele = <span class="cstat-no" title="statement not covered" >document.elementFromPoint(x, y);</span>
          // 只有面板状态等于1的情况下 并且 不等于 查询面板（此处需要原始DOM比较才行，$()对象以后就对不上了）才隐藏面板
<span class="cstat-no" title="statement not covered" >          if (panel.status == 1 &amp;&amp; ele != panel.searchBox.get(0)) {</span>
<span class="cstat-no" title="statement not covered" >            setTimeout(<span class="fstat-no" title="function not covered" >function () </span>{</span>
<span class="cstat-no" title="statement not covered" >              panel.status = 0;</span>
<span class="cstat-no" title="statement not covered" >              panel.control.slideUp(200);</span>
            }, 200);
          }
        });
&nbsp;
        // 技术文档：https://www.cnblogs.com/lonhon/p/7643095.html
        // 声明一个标记panel.enable，在compositionstart、compositionend两个事件过程之间的时候flag值为false，在input事件中通过flag的值来判断当前输入的状态。
<span class="cstat-no" title="statement not covered" >        panel.searchBox.on('compositionstart', <span class="fstat-no" title="function not covered" >function () </span>{</span>
<span class="cstat-no" title="statement not covered" >          panel.enable = false;</span>
        })
<span class="cstat-no" title="statement not covered" >        panel.searchBox.on('compositionend', <span class="fstat-no" title="function not covered" >function () </span>{</span>
<span class="cstat-no" title="statement not covered" >          panel.enable = true;</span>
        })
<span class="cstat-no" title="statement not covered" >        panel.searchBox.on('input', <span class="fstat-no" title="function not covered" >function () </span>{</span>
          let _this = <span class="cstat-no" title="statement not covered" >this;</span>
<span class="cstat-no" title="statement not covered" >          setTimeout(<span class="fstat-no" title="function not covered" >function () </span>{</span>
<span class="cstat-no" title="statement not covered" >            if (panel.enable) {</span>
              // 更新当前值
              let control_request_celldata = <span class="cstat-no" title="statement not covered" >[{</span>
                name: data.controlSourceText,
                searchKey: "LIKE",
                searchValue: [$(_this).val()]
              }, {name: data.controlSourceValue}];
              // 循环 关联数据 对查询数据进行过滤
&nbsp;
              // 抽取数据，并触发回调。
<span class="cstat-no" title="statement not covered" >              o.renderRequest({</span>
                cellData: control_request_celldata,
                config: data,
                callback: <span class="fstat-no" title="function not covered" >function (</span>result) {
                  // 防止因为异步造成先请求的数据最后才返回导致的查询异常，所以对顺序进行判定。
<span class="cstat-no" title="statement not covered" >                  if (result.status.sequenceIndex &gt; panel.sequence) {</span>
                    // 更新序列号
<span class="cstat-no" title="statement not covered" >                    panel.sequence = result.status.sequenceIndex;</span>
                    // 移除之前创建的
<span class="cstat-no" title="statement not covered" >                    panel.control.find(".Item").remove();</span>
                    // 追加数据
<span class="cstat-no" title="statement not covered" >                    $(result.content.queryData).each(<span class="fstat-no" title="function not covered" >function (</span>index, cell) {</span>
<span class="cstat-no" title="statement not covered" >                      panel.control.append("&lt;div class='Item' value='" + cell[data.controlSourceValue] + "'&gt;" + cell[data.controlSourceText] + "&lt;/div&gt;");</span>
                    });
                  }
                }
              });
            }
          }, 0);
        });
&nbsp;
<span class="cstat-no" title="statement not covered" >        panel.clearBox.on("click", <span class="fstat-no" title="function not covered" >function () </span>{</span>
<span class="cstat-no" title="statement not covered" >          if (content.textBox) {</span>
<span class="cstat-no" title="statement not covered" >            content.textBox.val("");</span>
          } else {
<span class="cstat-no" title="statement not covered" >            content.listBox.html("");</span>
          }
          // 标记为空，触发验证自动控件。
<span class="cstat-no" title="statement not covered" >          content.valueBox.val("");</span>
<span class="cstat-no" title="statement not covered" >          $(content.valueBox)[0].dispatchEvent(new Event('change'));</span>
        })
        ////////////////////////////////////////////////////////
      }
    }
  },
  // 渲染请求数据，有一些控件是需要获取数据源的。
  renderRequest: <span class="fstat-no" title="function not covered" >function (</span>data) {
    let o = <span class="cstat-no" title="statement not covered" >this;</span>
    // 请求后台八爪鱼API框架。
<span class="cstat-no" title="statement not covered" >    this.engine.request.api.post("/Octopus/Engine/List", {</span>
        id: data.config.controlSourceID,
        // 当 data.model 不存在时，采用树状请求模式，存在值时，采用标准模式。
        parentKey: data.model == undefined ? data.config.controlSourceParentKey : null,
        parentValue: data.model == undefined ? data.config.controlSourceParentValue : null,
        orderData: data.config.controlSourceOrder,
        cellData: data.cellData,
      },
      // 处理回调事件，通过分析data.status.code的状态来实现。
<span class="fstat-no" title="function not covered" >      function (</span>result) {
<span class="cstat-no" title="statement not covered" >        if (result.status.code == 200) {</span>
          // 回调
<span class="cstat-no" title="statement not covered" >          if (data.callback) {</span>
<span class="cstat-no" title="statement not covered" >            data.callback(result);</span>
          }
        } else {
<span class="cstat-no" title="statement not covered" >          o.engine.tips.error(result);</span>
        }
      });
  },
}
&nbsp;
export {
  oControlEngine
}
&nbsp;
&nbsp;
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
  Code coverage
  generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Mon Jan 20 2020 17:54:15 GMT+0800 (GMT+08:00)
</div>
</div>
<script src="..\..\..\..\prettify.js"></script>
<script>
window.onload = function () {
        if (typeof prettyPrint === 'function') {
            prettyPrint();
        }
};
</script>
<script src="..\..\..\..\sorter.js"></script>
</body>
</html>
